<?php
namespace app\apps\model;

class Apps extends \think\Model{
    /**
     * @name 判断表是否存在
     */
    public function hasTable($tableName = ''){
        $tables =  M()->db()->getTables();
        if($tableName){
            $tableName = $this->tablePrefix.$tableName;
        }else{
            $tableName = $this->getTableName();
        }
        if(!$tableName) return true;
        return in_array($tableName,$tables) ? true : false;
    }
    protected function _initialize(){}
}